<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkTreeSelection: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
<link rel="prev" href="GtkTreeModel.html" title="GtkTreeModel">
<link rel="next" href="GtkTreeViewColumn.html" title="GtkTreeViewColumn">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GtkTreeSelection.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GtkTreeSelection.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GtkTreeSelection.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
                  <a href="#GtkTreeSelection.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="GtkTreeModel.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GtkTreeViewColumn.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GtkTreeSelection"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkTreeSelection.top_of_page"></a>GtkTreeSelection</span></h2>
<p>GtkTreeSelection — The selection object for GtkTreeView</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GtkTreeSelection.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GtkTreeSelection.html#GtkTreeSelectionFunc" title="GtkTreeSelectionFunc ()">*GtkTreeSelectionFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<span class="c_punctuation">(</span><a class="link" href="GtkTreeSelection.html#GtkTreeSelectionForeachFunc" title="GtkTreeSelectionForeachFunc ()">*GtkTreeSelectionForeachFunc</a><span class="c_punctuation">)</span> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-set-mode" title="gtk_tree_selection_set_mode ()">gtk_tree_selection_set_mode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="gtk3-Standard-Enumerations.html#GtkSelectionMode" title="enum GtkSelectionMode"><span class="returnvalue">GtkSelectionMode</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-mode" title="gtk_tree_selection_get_mode ()">gtk_tree_selection_get_mode</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-set-select-function" title="gtk_tree_selection_set_select_function ()">gtk_tree_selection_set_select_function</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkTreeSelection.html#GtkTreeSelectionFunc" title="GtkTreeSelectionFunc ()"><span class="returnvalue">GtkTreeSelectionFunc</span></a>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-select-function" title="gtk_tree_selection_get_select_function ()">gtk_tree_selection_get_select_function</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gpointer</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-user-data" title="gtk_tree_selection_get_user_data ()">gtk_tree_selection_get_user_data</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="returnvalue">GtkTreeView</span></a> *
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-tree-view" title="gtk_tree_selection_get_tree_view ()">gtk_tree_selection_get_tree_view</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-selected" title="gtk_tree_selection_get_selected ()">gtk_tree_selection_get_selected</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-selected-foreach" title="gtk_tree_selection_selected_foreach ()">gtk_tree_selection_selected_foreach</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-selected-rows" title="gtk_tree_selection_get_selected_rows ()">gtk_tree_selection_get_selected_rows</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gint</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-count-selected-rows" title="gtk_tree_selection_count_selected_rows ()">gtk_tree_selection_count_selected_rows</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-select-path" title="gtk_tree_selection_select_path ()">gtk_tree_selection_select_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-unselect-path" title="gtk_tree_selection_unselect_path ()">gtk_tree_selection_unselect_path</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-path-is-selected" title="gtk_tree_selection_path_is_selected ()">gtk_tree_selection_path_is_selected</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-select-iter" title="gtk_tree_selection_select_iter ()">gtk_tree_selection_select_iter</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-unselect-iter" title="gtk_tree_selection_unselect_iter ()">gtk_tree_selection_unselect_iter</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">gboolean</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-iter-is-selected" title="gtk_tree_selection_iter_is_selected ()">gtk_tree_selection_iter_is_selected</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-select-all" title="gtk_tree_selection_select_all ()">gtk_tree_selection_select_all</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-unselect-all" title="gtk_tree_selection_unselect_all ()">gtk_tree_selection_unselect_all</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-select-range" title="gtk_tree_selection_select_range ()">gtk_tree_selection_select_range</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-unselect-range" title="gtk_tree_selection_unselect_range ()">gtk_tree_selection_unselect_range</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody><tr>
<td class="property_type"><a class="link" href="gtk3-Standard-Enumerations.html#GtkSelectionMode" title="enum GtkSelectionMode"><span class="type">GtkSelectionMode</span></a></td>
<td class="property_name"><a class="link" href="GtkTreeSelection.html#GtkTreeSelection--mode" title="The “mode” property">mode</a></td>
<td class="property_flags">Read / Write</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signal_proto_type">
<col width="300px" class="signal_proto_name">
<col width="200px" class="signal_proto_flags">
</colgroup>
<tbody><tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GtkTreeSelection.html#GtkTreeSelection-changed" title="The “changed” signal">changed</a></td>
<td class="signal_flags">Run First</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GtkTreeSelection.html#GtkTreeSelection-struct" title="GtkTreeSelection">GtkTreeSelection</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GtkTreeSelection.html#GtkTreeSelectionClass" title="GtkTreeSelectionClass">GtkTreeSelectionClass</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> GtkTreeSelection
</pre>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gtk/gtk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.description"></a><h2>Description</h2>
<p>The <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> object is a helper object to manage the selection
for a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> widget.  The <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> object is
automatically created when a new <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> widget is created, and
cannot exist independently of this widget.  The primary reason the
<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> objects exists is for cleanliness of code and API.
That is, there is no conceptual reason all these functions could not be
methods on the <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> widget instead of a separate function.</p>
<p>The <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> object is gotten from a <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a> by calling
<a class="link" href="GtkTreeView.html#gtk-tree-view-get-selection" title="gtk_tree_view_get_selection ()"><code class="function">gtk_tree_view_get_selection()</code></a>.  It can be manipulated to check the
selection status of the tree, as well as select and deselect individual
rows.  Selection is done completely view side.  As a result, multiple
views of the same model can have completely different selections.
Additionally, you cannot change the selection of a row on the model that
is not currently displayed by the view without expanding its parents
first.</p>
<p>One of the important things to remember when monitoring the selection of
a view is that the <a class="link" href="GtkTreeSelection.html#GtkTreeSelection-changed" title="The “changed” signal"><span class="type">“changed”</span></a> signal is mostly a hint.
That is, it may only emit one signal when a range of rows is selected.
Additionally, it may on occasion emit a <a class="link" href="GtkTreeSelection.html#GtkTreeSelection-changed" title="The “changed” signal"><span class="type">“changed”</span></a> signal
when nothing has happened (mostly as a result of programmers calling
select_row on an already selected row).</p>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="GtkTreeSelectionFunc"></a><h3>GtkTreeSelectionFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
<span class="c_punctuation">(</span>*GtkTreeSelectionFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                         <em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *model</code></em>,
                         <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>,
                         <em class="parameter"><code><span class="type">gboolean</span> path_currently_selected</code></em>,
                         <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
<p>A function used by <a class="link" href="GtkTreeSelection.html#gtk-tree-selection-set-select-function" title="gtk_tree_selection_set_select_function ()"><code class="function">gtk_tree_selection_set_select_function()</code></a> to filter
whether or not a row may be selected.  It is called whenever a row's
state might change.  A return value of <code class="literal">TRUE</code> indicates to <em class="parameter"><code>selection</code></em>

that it is okay to change the selection.</p>
<div class="refsect3">
<a name="GtkTreeSelectionFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> being viewed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> of the row in question</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path_currently_selected</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code>, if the path is currently selected</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user data. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="GtkTreeSelectionFunc.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code>, if the selection state of the row can be toggled</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="GtkTreeSelectionForeachFunc"></a><h3>GtkTreeSelectionForeachFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
<span class="c_punctuation">(</span>*GtkTreeSelectionForeachFunc<span class="c_punctuation">)</span> (<em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *model</code></em>,
                                <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>,
                                <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
                                <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
<p>A function used by <a class="link" href="GtkTreeSelection.html#gtk-tree-selection-selected-foreach" title="gtk_tree_selection_selected_foreach ()"><code class="function">gtk_tree_selection_selected_foreach()</code></a> to map all
selected rows.  It will be called on every selected row in the view.</p>
<div class="refsect3">
<a name="GtkTreeSelectionForeachFunc.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> being viewed</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> of a selected row</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>iter</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> pointing to a selected row</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user data. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="This parameter is a 'user_data', for callbacks; many bindings can pass NULL here."><span class="acronym">closure</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-set-mode"></a><h3>gtk_tree_selection_set_mode ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_set_mode (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                             <em class="parameter"><code><a class="link" href="gtk3-Standard-Enumerations.html#GtkSelectionMode" title="enum GtkSelectionMode"><span class="type">GtkSelectionMode</span></a> type</code></em>);</pre>
<p>Sets the selection mode of the <em class="parameter"><code>selection</code></em>
.  If the previous type was
<a class="link" href="gtk3-Standard-Enumerations.html#GTK-SELECTION-MULTIPLE:CAPS"><span class="type">GTK_SELECTION_MULTIPLE</span></a>, then the anchor is kept selected, if it was
previously selected.</p>
<div class="refsect3">
<a name="gtk-tree-selection-set-mode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type</p></td>
<td class="parameter_description"><p>The selection mode</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-get-mode"></a><h3>gtk_tree_selection_get_mode ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-Standard-Enumerations.html#GtkSelectionMode" title="enum GtkSelectionMode"><span class="returnvalue">GtkSelectionMode</span></a>
gtk_tree_selection_get_mode (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Gets the selection mode for <em class="parameter"><code>selection</code></em>
. See
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-set-mode" title="gtk_tree_selection_set_mode ()"><code class="function">gtk_tree_selection_set_mode()</code></a>.</p>
<div class="refsect3">
<a name="gtk-tree-selection-get-mode.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>a <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-get-mode.returns"></a><h4>Returns</h4>
<p> the current selection mode</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-set-select-function"></a><h3>gtk_tree_selection_set_select_function ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_set_select_function
                               (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                <em class="parameter"><code><a class="link" href="GtkTreeSelection.html#GtkTreeSelectionFunc" title="GtkTreeSelectionFunc ()"><span class="type">GtkTreeSelectionFunc</span></a> func</code></em>,
                                <em class="parameter"><code><span class="type">gpointer</span> data</code></em>,
                                <em class="parameter"><code><span class="type">GDestroyNotify</span> destroy</code></em>);</pre>
<p>Sets the selection function.</p>
<p>If set, this function is called before any node is selected or unselected,
giving some control over which nodes are selected. The select function
should return <code class="literal">TRUE</code> if the state of the node may be toggled, and <code class="literal">FALSE</code>
if the state of the node should be left unchanged.</p>
<div class="refsect3">
<a name="gtk-tree-selection-set-select-function.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>The selection function. May be <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>The selection function’s data. May be <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>destroy</p></td>
<td class="parameter_description"><p>The destroy function for user data.  May be <code class="literal">NULL</code></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-get-select-function"></a><h3>gtk_tree_selection_get_select_function ()</h3>
<pre class="programlisting"><a class="link" href="GtkTreeSelection.html#GtkTreeSelectionFunc" title="GtkTreeSelectionFunc ()"><span class="returnvalue">GtkTreeSelectionFunc</span></a>
gtk_tree_selection_get_select_function
                               (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Returns the current selection function.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-tree-selection-get-select-function.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-get-select-function.returns"></a><h4>Returns</h4>
<p> The function.</p>
</div>
<p class="since">Since: 2.14</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-get-user-data"></a><h3>gtk_tree_selection_get_user_data ()</h3>
<pre class="programlisting"><span class="returnvalue">gpointer</span>
gtk_tree_selection_get_user_data (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Returns the user data for the selection function.</p>
<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="gtk-tree-selection-get-user-data.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-get-user-data.returns"></a><h4>Returns</h4>
<p> The user data.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-get-tree-view"></a><h3>gtk_tree_selection_get_tree_view ()</h3>
<pre class="programlisting"><a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="returnvalue">GtkTreeView</span></a> *
gtk_tree_selection_get_tree_view (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Returns the tree view associated with <em class="parameter"><code>selection</code></em>
.</p>
<div class="refsect3">
<a name="gtk-tree-selection-get-tree-view.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-get-tree-view.returns"></a><h4>Returns</h4>
<p>A <a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a>. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-get-selected"></a><h3>gtk_tree_selection_get_selected ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_tree_selection_get_selected (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                 <em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> **model</code></em>,
                                 <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
<p>Sets <em class="parameter"><code>iter</code></em>
 to the currently selected node if <em class="parameter"><code>selection</code></em>
 is set to
<a class="link" href="gtk3-Standard-Enumerations.html#GTK-SELECTION-SINGLE:CAPS"><span class="type">GTK_SELECTION_SINGLE</span></a> or <a class="link" href="gtk3-Standard-Enumerations.html#GTK-SELECTION-BROWSE:CAPS"><span class="type">GTK_SELECTION_BROWSE</span></a>.  <em class="parameter"><code>iter</code></em>
 may be NULL if you
just want to test if <em class="parameter"><code>selection</code></em>
 has any selected nodes.  <em class="parameter"><code>model</code></em>
 is filled
with the current model as a convenience.  This function will not work if you
use <em class="parameter"><code>selection</code></em>
 is <a class="link" href="gtk3-Standard-Enumerations.html#GTK-SELECTION-MULTIPLE:CAPS"><span class="type">GTK_SELECTION_MULTIPLE</span></a>.</p>
<div class="refsect3">
<a name="gtk-tree-selection-get-selected.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>A pointer to set to the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>, or NULL. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>iter</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a>, or NULL. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-get-selected.returns"></a><h4>Returns</h4>
<p> TRUE, if there is a selected node.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-selected-foreach"></a><h3>gtk_tree_selection_selected_foreach ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_selected_foreach (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                     <em class="parameter"><code><a class="link" href="GtkTreeSelection.html#GtkTreeSelectionForeachFunc" title="GtkTreeSelectionForeachFunc ()"><span class="type">GtkTreeSelectionForeachFunc</span></a> func</code></em>,
                                     <em class="parameter"><code><span class="type">gpointer</span> data</code></em>);</pre>
<p>Calls a function for each selected node. Note that you cannot modify
the tree or selection from within this function. As a result,
<a class="link" href="GtkTreeSelection.html#gtk-tree-selection-get-selected-rows" title="gtk_tree_selection_get_selected_rows ()"><code class="function">gtk_tree_selection_get_selected_rows()</code></a> might be more useful.</p>
<div class="refsect3">
<a name="gtk-tree-selection-selected-foreach.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>func</p></td>
<td class="parameter_description"><p>The function to call for each selected node. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="The callback is valid only during the call to the method."><span class="acronym">scope call</span></acronym>]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>data</p></td>
<td class="parameter_description"><p>user data to pass to the function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-get-selected-rows"></a><h3>gtk_tree_selection_get_selected_rows ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
gtk_tree_selection_get_selected_rows (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                      <em class="parameter"><code><a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> **model</code></em>);</pre>
<p>Creates a list of path of all selected rows. Additionally, if you are
planning on modifying the model after calling this function, you may
want to convert the returned list into a list of <span class="type">GtkTreeRowReferences</span>.
To do this, you can use <a class="link" href="GtkTreeModel.html#gtk-tree-row-reference-new" title="gtk_tree_row_reference_new ()"><code class="function">gtk_tree_row_reference_new()</code></a>.</p>
<p>To free the return value, use:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="n">g_list_free_full</span> <span class="p">(</span><span class="n">list</span><span class="p">,</span> <span class="p">(</span><span class="n">GDestroyNotify</span><span class="p">)</span> <span class="n">gtk_tree_path_free</span><span class="p">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
<div class="refsect3">
<a name="gtk-tree-selection-get-selected-rows.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>model</p></td>
<td class="parameter_description"><p>A pointer to set to the <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>, or <code class="literal">NULL</code>. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>][<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-get-selected-rows.returns"></a><h4>Returns</h4>
<p>A <span class="type">GList</span> containing a <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> for each selected row. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkTreePath][<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-count-selected-rows"></a><h3>gtk_tree_selection_count_selected_rows ()</h3>
<pre class="programlisting"><span class="returnvalue">gint</span>
gtk_tree_selection_count_selected_rows
                               (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Returns the number of rows that have been selected in <em class="parameter"><code>tree</code></em>
.</p>
<div class="refsect3">
<a name="gtk-tree-selection-count-selected-rows.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-count-selected-rows.returns"></a><h4>Returns</h4>
<p> The number of rows selected.</p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-select-path"></a><h3>gtk_tree_selection_select_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_select_path (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
<p>Select the row at <em class="parameter"><code>path</code></em>
.</p>
<div class="refsect3">
<a name="gtk-tree-selection-select-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to be selected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-unselect-path"></a><h3>gtk_tree_selection_unselect_path ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_unselect_path (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                  <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
<p>Unselects the row at <em class="parameter"><code>path</code></em>
.</p>
<div class="refsect3">
<a name="gtk-tree-selection-unselect-path.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to be unselected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-path-is-selected"></a><h3>gtk_tree_selection_path_is_selected ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_tree_selection_path_is_selected (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                     <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *path</code></em>);</pre>
<p>Returns <code class="literal">TRUE</code> if the row pointed to by <em class="parameter"><code>path</code></em>
 is currently selected.  If <em class="parameter"><code>path</code></em>

does not point to a valid location, <code class="literal">FALSE</code> is returned</p>
<div class="refsect3">
<a name="gtk-tree-selection-path-is-selected.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>path</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> to check selection on.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-path-is-selected.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code> if <em class="parameter"><code>path</code></em>
is selected.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-select-iter"></a><h3>gtk_tree_selection_select_iter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_select_iter (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
<p>Selects the specified iterator.</p>
<div class="refsect3">
<a name="gtk-tree-selection-select-iter.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>iter</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to be selected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-unselect-iter"></a><h3>gtk_tree_selection_unselect_iter ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_unselect_iter (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                  <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
<p>Unselects the specified iterator.</p>
<div class="refsect3">
<a name="gtk-tree-selection-unselect-iter.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>iter</p></td>
<td class="parameter_description"><p>The <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> to be unselected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-iter-is-selected"></a><h3>gtk_tree_selection_iter_is_selected ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span>
gtk_tree_selection_iter_is_selected (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                     <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>);</pre>
<p>Returns <code class="literal">TRUE</code> if the row at <em class="parameter"><code>iter</code></em>
 is currently selected.</p>
<div class="refsect3">
<a name="gtk-tree-selection-iter-is-selected.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>iter</p></td>
<td class="parameter_description"><p>A valid <a class="link" href="GtkTreeModel.html#GtkTreeIter"><span class="type">GtkTreeIter</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gtk-tree-selection-iter-is-selected.returns"></a><h4>Returns</h4>
<p> <code class="literal">TRUE</code>, if <em class="parameter"><code>iter</code></em>
is selected</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-select-all"></a><h3>gtk_tree_selection_select_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_select_all (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Selects all the nodes. <em class="parameter"><code>selection</code></em>
 must be set to <a class="link" href="gtk3-Standard-Enumerations.html#GTK-SELECTION-MULTIPLE:CAPS"><span class="type">GTK_SELECTION_MULTIPLE</span></a>
mode.</p>
<div class="refsect3">
<a name="gtk-tree-selection-select-all.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-unselect-all"></a><h3>gtk_tree_selection_unselect_all ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_unselect_all (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>);</pre>
<p>Unselects all the nodes.</p>
<div class="refsect3">
<a name="gtk-tree-selection-unselect-all.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-select-range"></a><h3>gtk_tree_selection_select_range ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_select_range (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                 <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *start_path</code></em>,
                                 <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *end_path</code></em>);</pre>
<p>Selects a range of nodes, determined by <em class="parameter"><code>start_path</code></em>
 and <em class="parameter"><code>end_path</code></em>
 inclusive.
<em class="parameter"><code>selection</code></em>
 must be set to <a class="link" href="gtk3-Standard-Enumerations.html#GTK-SELECTION-MULTIPLE:CAPS"><span class="type">GTK_SELECTION_MULTIPLE</span></a> mode.</p>
<div class="refsect3">
<a name="gtk-tree-selection-select-range.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_path</p></td>
<td class="parameter_description"><p>The initial node of the range.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end_path</p></td>
<td class="parameter_description"><p>The final node of the range.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-tree-selection-unselect-range"></a><h3>gtk_tree_selection_unselect_range ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gtk_tree_selection_unselect_range (<em class="parameter"><code><a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *selection</code></em>,
                                   <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *start_path</code></em>,
                                   <em class="parameter"><code><a class="link" href="GtkTreeModel.html#GtkTreePath"><span class="type">GtkTreePath</span></a> *end_path</code></em>);</pre>
<p>Unselects a range of nodes, determined by <em class="parameter"><code>start_path</code></em>
 and <em class="parameter"><code>end_path</code></em>

inclusive.</p>
<div class="refsect3">
<a name="gtk-tree-selection-unselect-range.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>selection</p></td>
<td class="parameter_description"><p>A <a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>start_path</p></td>
<td class="parameter_description"><p>The initial node of the range.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>end_path</p></td>
<td class="parameter_description"><p>The initial node of the range.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.2</p>
</div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GtkTreeSelection-struct"></a><h3>GtkTreeSelection</h3>
<pre class="programlisting">typedef struct _GtkTreeSelection GtkTreeSelection;</pre>
</div>
<hr>
<div class="refsect2">
<a name="GtkTreeSelectionClass"></a><h3>GtkTreeSelectionClass</h3>
<pre class="programlisting">typedef struct {
  GObjectClass parent_class;

  void (* changed) (GtkTreeSelection *selection);
} GtkTreeSelectionClass;
</pre>
<div class="refsect3">
<a name="GtkTreeSelectionClass.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody><tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GtkTreeSelectionClass.changed"></a>changed</code></em> ()</p></td>
<td class="struct_member_description"><p>Signal emitted whenever the selection has (possibly) changed.</p></td>
<td class="struct_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkTreeSelection--mode"></a><h3>The <code class="literal">“mode”</code> property</h3>
<pre class="programlisting">  “mode”                     <a class="link" href="gtk3-Standard-Enumerations.html#GtkSelectionMode" title="enum GtkSelectionMode"><span class="type">GtkSelectionMode</span></a></pre>
<p>Selection mode.
See <a class="link" href="GtkTreeSelection.html#gtk-tree-selection-set-mode" title="gtk_tree_selection_set_mode ()"><code class="function">gtk_tree_selection_set_mode()</code></a> for more information on this property.</p>
<p>Owner: GtkTreeSelection</p>
<p>Flags: Read / Write</p>
<p>Default value: GTK_SELECTION_SINGLE</p>
<p class="since">Since: <a class="link" href="api-index-3-2.html#api-index-3.2">3.2</a></p>
</div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GtkTreeSelection-changed"></a><h3>The <code class="literal">“changed”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="GtkTreeSelection.html" title="GtkTreeSelection"><span class="type">GtkTreeSelection</span></a> *treeselection,
               <span class="type">gpointer</span>          user_data)</pre>
<p>Emitted whenever the selection has (possibly) changed. Please note that
this signal is mostly a hint.  It may only be emitted once when a range
of rows are selected, and it may occasionally be emitted when nothing
has happened.</p>
<div class="refsect3">
<a name="GtkTreeSelection-changed.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>treeselection</p></td>
<td class="parameter_description"><p>the object which received the signal.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run First</p>
</div>
</div>
<div class="refsect1">
<a name="GtkTreeSelection.see-also"></a><h2>See Also</h2>
<p><a class="link" href="GtkTreeView.html" title="GtkTreeView"><span class="type">GtkTreeView</span></a>, <a class="link" href="GtkTreeViewColumn.html" title="GtkTreeViewColumn"><span class="type">GtkTreeViewColumn</span></a>, <a class="link" href="GtkTreeModel.html" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a>,
<a class="link" href="GtkTreeSortable.html" title="GtkTreeSortable"><span class="type">GtkTreeSortable</span></a>, <a class="link" href="GtkTreeModelSort.html" title="GtkTreeModelSort"><span class="type">GtkTreeModelSort</span></a>, <a class="link" href="GtkListStore.html" title="GtkListStore"><span class="type">GtkListStore</span></a>, <a class="link" href="GtkTreeStore.html" title="GtkTreeStore"><span class="type">GtkTreeStore</span></a>,
<a class="link" href="GtkCellRenderer.html" title="GtkCellRenderer"><span class="type">GtkCellRenderer</span></a>, <a class="link" href="GtkCellEditable.html" title="GtkCellEditable"><span class="type">GtkCellEditable</span></a>, <a class="link" href="GtkCellRendererPixbuf.html" title="GtkCellRendererPixbuf"><span class="type">GtkCellRendererPixbuf</span></a>,
<a class="link" href="GtkCellRendererText.html" title="GtkCellRendererText"><span class="type">GtkCellRendererText</span></a>, <a class="link" href="GtkCellRendererToggle.html" title="GtkCellRendererToggle"><span class="type">GtkCellRendererToggle</span></a>, <a class="link" href="gtk3-GtkTreeView-drag-and-drop.html" title="GtkTreeView drag-and-drop">GtkTreeView drag-and-drop</a></p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>